
#v3d_build DIRs
v3dbuild_DIR		= ../../../core/v3d_build
v3dbuild_INCDIR 	= $(v3dbuild_DIR)/inc
v3dbuild_LIBDIR 	= $(v3dbuild_DIR)/lib

# source files.
SRCDIR = ../src
OBJDIR = ./obj

FILES =  	testMain.cpp 	

#OBJ = $(SRC:.cpp=.o)
OBJ_FILES = $(FILES:.cpp=.o)
OBJ =  $(patsubst %,$(OBJDIR)/%,$(OBJ_FILES))

SRC =  $(patsubst %,$(SRCDIR)/%,$(FILES))

OUT = test_v3d_interface

# include directories
INCLUDES = -I. -I$(v3dbuild_INCDIR)

# C++ compiler flags (-g -O2 -Wall)
CCFLAGS = -g

# compiler
CCC = g++

# library paths
LIBS = -L$(v3dbuild_LIBDIR) -lv3d -lv3d_interface -lv3d_renderer -lglut -lGLU

# compile flags
LDFLAGS = -g

.SUFFIXES: .cpp

build: dep $(OUT)

$(OBJDIR)/%.o : $(SRCDIR)/%.cpp
	$(CCC) $(INCLUDES) $(CCFLAGS) -c $< -o $@

$(OUT): $(OBJ)
	$(CCC) -o $@ $^ $(CCFLAGS) $(LIBS)

depend: dep

dep:
	#makedepend -- $(CFLAGS) -- $(INCLUDES) $(SRC)

clean:
	rm -f $(OBJ) $(OUT)
	
run: buildall
	./$(OUT) &
	
rebuild:
	@echo "..........v3d test started............. "
	$(MAKE) clean
	$(MAKE) build
	@echo "..........v3d test ended.......... "
	
buildall:
	(cd $(v3dbuild_DIR)/mk; $(MAKE) rebuild)
	$(MAKE) rebuild
	
	
